package com.itheima.mapper;
import java.util.List;

import com.itheima.pojo.Dept;
import org.apache.ibatis.annotations.*;

import com.itheima.pojo.Grades;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
* @author VRMMO
* @description 针对表【grades】的数据库操作Mapper
* @createDate 2025-03-26 20:16:47
* @Entity com.itheima.pojo.Grades
*/
@Mapper
public interface GradesMapper extends BaseMapper<Grades> {

    /**
     * 单个删除
     * @param gradeid
     */
    int deleteByGradeid(@Param("gradeid") Integer gradeid);

    /**
     * 新增年级
     * @param grades
     */
    @Insert("insert into grades(gradename, description) values(#{gradename},#{description})")
    int inserts(Grades grades);

    /**
     * 根据ID查询年级
     * @param gradeid
     * @return
     */
    List<Grades> selectByGradeid(@Param("gradeid") Integer gradeid);

    int addSelective(Grades grades);


    @Select("select * from grades where gradeid = #{gradeid}")
    Dept getById(Integer gradeid);

    @Update("update grades set gradename=#{gradename}, description=#{description} where gradeid=#{gradeid}")
    void update(Grades grades);

}




